import request from "./request"

export function login(type, params) {
    return request({
        url: type + "/login",
        method: "post",
        data: params
    })
}

export function register(type, params) {
    return request({
        url: type + "/register",
        method: "post",
        data: params
    })
}

export function getAll(type) {
    return request({
        url: type + "/getAll",
        method: "get",
    })
}

export function getTop(type){
    return request({
        url: type+"/getTop",
        method: "get",
    })
}

export function addOne(type, params) {
    return request({
        url: type + "/addOne",
        method: "post",
        data: params
    })
}

export function deleteOne(type, params) {
    return request({
        url: type + "/deleteOne/" + params,
        method: "delete",
    })
}

export function deleteAll(type, params) {
    return request({
        url: type + "/deleteAll",
        method: "post",
        data: params
    })
}

export function selectOne(type, params) {
    return request({
        url: type + "/selectOne/" + params,
        method: "get"
    })
}

export function selectGoods(type,params){
    return request({
        url: type+"/selectGoods/"+params,
        method: "get"
    })
}

export function selectGood(type,params){
    return request({
        url: type+"/selectGood/"+params,
        method: "get"
    })
}

export function updateOne(type, params) {
    return request({
        url: type + "/updateOne",
        method: "put",
        data: params
    })
}

export function conditionQuery(type, params) {
    return request({
        url: type + "/conditionQuery",
        method: "post",
        data: params
    })
}

export function getInfo(type,params){
    return request({
        url:type+"/getInfo/"+params,
        method:"get",
    })
}

export function selectGoodsByType(type,params){
    return request({
        url:type+"/selectGoodsByType/"+params,
        method:"get",
    })
}

export function selectByUser(type,params){
    return request({
        url:type+"/getByUser/"+params,
        method:"get"
    })
}
